package com.jack.redismq.producer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

/**
 * Created by zhang_j on 2019/12/3
 */
@Service
public class Producer {
    @Autowired
    private RedisTemplate redisTemplate;

    public void produce(Object msg){
        redisTemplate.convertAndSend("demo-channel",msg);
    }
}
